// The Vindictive Coach
// UVa ID: 702
// Verdict: Accepted
// Submission Date: 2018-10-11
// UVa Run Time: 0.000s
//
// 版权所有（C）2018，邱秋。metaphysis # yeah dot net

#include <bits/stdc++.h>

using namespace std;

long long trick[22][22] = {
    {1},
    {1, 1},
    {1, 1, 1},
    {1, 1, 2, 2},
    {1, 2, 4, 5, 5},
    {2, 5, 10, 14, 16, 16},
    {5, 16, 32, 46, 56, 61, 61},
    {16, 61, 122, 178, 224, 256, 272, 272},
    {61, 272, 544, 800, 1024, 1202, 1324, 1385, 1385},
    {272, 1385, 2770, 4094, 5296, 6320, 7120, 7664, 7936, 7936},
    {1385, 7936, 15872, 23536, 30656, 36976, 42272, 46366, 49136, 50521, 50521},
    {7936, 50521, 101042, 150178, 196544, 238816, 275792, 306448, 329984, 345856, 353792, 353792},
    {50521, 353792, 707584, 1053440, 1383424, 1689872, 1965664, 2204480, 2401024, 2551202, 2652244, 2702765, 2702765},
    {353792, 2702765, 5405530, 8057774, 10608976, 13010000, 15214480, 17180144, 18870016, 20253440, 21306880, 22014464, 22368256, 22368256},
    {2702765, 22368256, 44736512, 66750976, 88057856, 108311296, 127181312, 144361456, 159575936, 172585936, 183194912, 191252686, 196658216, 199360981, 199360981},
    {22368256, 199360981, 398721962, 595380178, 786632864, 969827776, 1142413712, 1301989648, 1446351104, 1573532416, 1681843712, 1769901568, 1836652544, 1881389056, 1903757312, 1903757312},
    {199360981, 1903757312, 3807514624, 5688903680, 7525556224, 9295457792, 10977301504, 12550833920, 13997185024, 15299174672, 16441588384, 17411416160, 18198049024, 18793429202, 19192151164, 19391512145, 19391512145},
    {1903757312, 19391512145, 38783024290, 57975175454, 76768604656, 94966653680, 112378069840, 128819658224, 144118832896, 158116017920, 170666851840, 181644153344, 190939611136, 198465167360, 204154071040, 207961585664, 209865342976, 209865342976},
    {19391512145, 209865342976, 419730685952, 627692271616, 831846342656, 1030311510016, 1221251121152, 1402895274496, 1573562126336, 1731678144256, 1875796977152, 2004616635376, 2116994705216, 2211961358896, 2288729963552, 2346705139006, 2385488163296, 2404879675441, 2404879675441},
    {209865342976, 2404879675441, 4809759350882, 7195247514178, 9541952653184, 11830682616736, 14042643975632, 16159638680848, 18164255316224, 20040052293376, 21771730437632, 23345292563968, 24748187838464, 25969438959616, 26999750469632, 27831596812288, 28459289083904, 28879019769856, 29088885112832, 29088885112832},
    {2404879675441, 29088885112832, 58177770225664, 87056789995520, 115516079079424, 143347675891712, 170347426361344, 196316865320960, 221065053159424, 244410345723392, 266182076161024, 286222128454400, 304386383770624, 320546022451472, 334588666427104, 346419349043840, 355961301697024, 363156549211202, 367966308562084, 370371188237525, 370371188237525},
    {29088885112832, 370371188237525, 740742376475050, 1108708685037134, 1471865234248336, 1827826535945360, 2174245884989200, 2508834551416304, 2829380573867776, 3133766957638400, 3419989086092800, 3686171162253824, 3930581507977216, 4151646561136640, 4347963426457600, 4518310852818944, 4661658528710656, 4777174607790080, 4864231397785600, 4922409168011264, 4951498053124096, 4951498053124096}
};

int main(int argc, char *argv[])
{
    cin.tie(0), cout.tie(0), ios::sync_with_stdio(false);

    int N, M;
    while (cin >> N >> M) cout << trick[N - 1][M - 1] << '\n';

    return 0;
}
